// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   ClassUtil.java

package com.kingdee.eas.minghua.common;

import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;

public class ClassUtil
{


    public ClassUtil()
    {
    }

    public static URL getResource(final String resourceName,
			final Class callingClass) {
		URL url = null;
		try {
			url = (URL) AccessController.doPrivileged(new PrivilegedAction() {
				public Object run() {
					return Thread.currentThread().getContextClassLoader()
							.getResource(resourceName);
				}
			});
			if (url == null) {
				url = (URL) AccessController
						.doPrivileged(new PrivilegedAction() {
							public Object run() {
								return ClassUtil.class.getClassLoader()
										.getResource(resourceName);
							}
						});

			}
			if (url == null) {
				url = (URL) AccessController
						.doPrivileged(new PrivilegedAction() {
							public Object run() {
								return callingClass.getClassLoader()
										.getResource(resourceName);
							}
						});
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return url;
	}
}
